<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	<body>
		<h1>网页在五秒后跳转到攀枝花学院!</h1>
		<h1>倒计时<span>5</span>s!</h1>
		<button type="button" onclick="fun()">停止跳转</button>
		<script type="text/javascript">
			var flag=false
			function display(){
				let t=document.querySelector("h1>span").innerText
				if(t>1){
				document.querySelector("h1>span").innerText=t-1
				}
			}
			let t1=setInterval(display,1000)
			function setUrl(){
			window.location.href="http://www.pzhu.cn"
			}
			let t1=setInterval(display,1000)
			function fun(){
   				if(flag){
   					clearTimeout(t2)
   					clearInterval(t1)
					document.querySelector("button").innerHTML="继续跳转"
   					flag=false;
   				}
   				else{
   					let t1=setInterval(display,1000)
					let t1=setInterval(display,1000)
   					flag=true;
					document.querySelector("button").innerHTML="停止跳转"
   				}
				
				
			}
			
		</script>
	</body>
</html>
